package com.syn.synold4s.repository;

import com.gaoyi.basemodule.baseCallback.Callback;
import com.gaoyi.basemodule.baseCallback.OnResultListener;
import com.gaoyi.basemodule.baseUtil.OKHttpUtil;
import com.gaoyi.basemodule.baseUtil.SPUtil;
import com.gaoyi.basemodule.baseconstant.SPName;

import java.lang.reflect.Type;

public class SurveillanceRepository {

//    public void cctv(int pageIndex, String sort, OnResultListener onResultListener, Type typeofT) {
//        String projCode = SPUtil.getInstance().getString(SPName.PROJ_CODE);
//        OKHttpUtil.getInstance().getAsync(OKHttpUtil.NET_URL + "/api/ows?projCode=" + projCode + "&tabPage=CCTV&synProj=SynCCTV&orderBy=" + sort + "&pageIndex=" + pageIndex, new Callback() {
//            @Override
//            public void onSuccess(Object obj) {
//                onResultListener.onSuccess(obj);
//            }
//
//            @Override
//            public void onFailed(Exception e) {
//                onResultListener.onFails(e);
//            }
//        }, typeofT);
//    }

    public void cctv(Object bean, OnResultListener onResultListener, Type typeofT) {
        OKHttpUtil.getInstance().postAsync(OKHttpUtil.NET_URL + "/api/device/cctv", bean, new Callback() {
            @Override
            public void onSuccess(Object obj) {
                onResultListener.onSuccess(obj);
            }

            @Override
            public void onFailed(Exception e) {
                onResultListener.onFails(e);
            }
        }, typeofT);
    }

}
